#include <QCoreApplication>
#include <QTECore/JLog>
#include <thread>

using namespace QTE;

int main()
{
	JMessageLogger::Info info;
	info.category = "test";
	info.mask = 4;

	JMessageLogger log(info); Q_UNUSED(log);
//	log.setHeaderBreaksALine(true);

	std::thread thread0([]()
	{
		for(int i=0; 1; i++)
		{
			jDebug() << "hello" << i;
			std::this_thread::sleep_for(std::chrono::milliseconds(1000));
		}
	});
	Q_UNUSED(thread0);

	std::thread thread1([]()
	{
		for(int i=0; 1; i++)
		{
			jInfo() << "world" << i;
			std::this_thread::sleep_for(std::chrono::milliseconds(1000));
		}
	});
	Q_UNUSED(thread1);

	std::thread thread2([]()
	{
		for(int i=0; 1; i++)
		{
			jWarning() << "你好" << i;
			std::this_thread::sleep_for(std::chrono::milliseconds(1000));
		}
	});
	Q_UNUSED(thread2);

	std::thread thread3([]()
	{
		for(int i=0; 1; i++)
		{
			jError() << "世界" << i;
			std::this_thread::sleep_for(std::chrono::milliseconds(1000));
		}
	});
	Q_UNUSED(thread3);

	thread0.join();
	thread1.join();
	thread2.join();
	thread3.join();

//	jFatal("abort");
	return 0;
}
